import { createApp } from 'vue'

import App from './App.vue'
import VButton from "@/materials/v-button.vue"
import VSelect from "@/materials/v-select.vue"


import { routes } from './routes.js'
import { createRouter, createWebHistory } from 'vue-router'
import ElementPlus from 'element-plus'
const app = createApp(App)

import './tailwind.css'
import 'element-plus/dist/index.css'

const router = createRouter({
  history: createWebHistory(),
  routes,
})

app.use(ElementPlus)
app.use(router)

const components = [
  'v-button',
  'v-select'
]

components.forEach(key=>{
  app.component(key,()=>import(`@/materials/${key}.vue`))
})

// app.component('v-button',VButton); //把自定义的v-button注册为全局组件
// app.component('el-select',VSelect);
app.mount('#app')
